import request from '@/utils/request'
/**
* @description:获取组织部门列表
*/
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

/**
* @description:添加部门
*/
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
* @description:根据id获取部门详情
*/
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

/**
* @description:根据id编辑部门详情
*/
export function editDepartDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
/**
* @description:根据id删除部门
*/
export function delDepartDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
